package com.app.controller;

import com.app.common.ConstantTool;
import com.app.conf.RedisService;
import com.app.model.PositionModel;
import com.app.model.TbcConfigModel;
import com.app.service.SpecialityManageService;
import com.app.service.TbcConfigService;
import com.app.util.Result;
import com.app.vo.EducationVo;
import com.app.vo.EminentPersonVo;
import com.app.vo.IdNameChildrenVo;
import com.app.vo.IdNameVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//共用配置
@RestController
@Controller
@RequestMapping("/jiuquan/config")
public class ConfigsController {

    @Autowired
    private RedisService redisService;

    @Autowired
    private TbcConfigService tbcConfigService;

    @Autowired
    private SpecialityManageService specialityManageService;


    //查询地区列表
    @GetMapping("/getAreasList")
    public Result getAreasList() {
        List<EducationVo> areaVoList = ConstantTool.AREA_VO_LIST;
        return Result.success(areaVoList);
    }

    //查询三级职位或二级行业
    @GetMapping("/getTndustryName")
    public Result<Object> findAll() {
        List<PositionModel> modelList = (List<PositionModel>) redisService.getStringKey("findJobNameList");
        return Result.success(modelList);
    }


    //专业列表
    @GetMapping("/getSpecialityList")
    public Result<Object> getSpecialityList() {
        List<IdNameVo> specialityIdName = specialityManageService.getSpecialityIdName();
        return Result.success(specialityIdName);
    }

    //民族列表
    @GetMapping("/getNationList")
    public Result<Object> getNationList() {
        List<TbcConfigModel> nationList = tbcConfigService.getNationList();
        return Result.success(nationList);
    }

    //获取学历列表
    @GetMapping("/getEducationList")
    public Result<Object> getEducationList() {
        List<EducationVo> educationList = tbcConfigService.getEducationList();
        return Result.success(educationList);
    }
}
